<template>
  <el-header style="height: 100px;background-color: #B9403E">
    <!--<h1>上海历史博物馆管理后台</h1>-->
    <img src="@/assets/logo.png" style="height: 60px;margin: auto 0;"/>
    <div class="navbar-actions">
      <span>{{currentUser.name}}</span>
      <span style="cursor: pointer" @click="logout">
        <i class="fa fa-power-off"></i>
        注销
      </span>
    </div>
  </el-header>
</template>

<script>
  import {setStore,getStore,removeStore} from '@/utils/storage'
  export default {
    name:'asd',
    data() {
      return {
        currentUser: {}
      }
    },

    methods: {
      logout() {
        removeStore('user_museum');
        this.$router.push('/login');
      }
    },

    mounted() {
      this.currentUser = JSON.parse(getStore('user_museum'));
    }
  }
</script>

<style lang="scss" scoped>
  header {
    font-family: "微软雅黑", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    color: white;
    background-color: #409EFF;
    height: 100px;
    line-height: 100px;
    display: flex;
    justify-content: space-between;
    align-content: center;

    h1 {
      margin: 0;
    }

    .navbar-actions {
      font-size: 13px;

      span {
        margin-left: 1em;
      }

      img {
        height: 1.5em;
        vertical-align: middle;
      }
    }
  }
</style>
